package com.yzc.android.ui;

import android.view.View;
import android.view.View.OnClickListener;

import java.util.ArrayList;

import com.yzc.android.ui.base.fragment.GridMenuFragment;

/**
 * Created by yzc on 16/4/25.
 */
public class GridMenuDemoFragment extends GridMenuFragment {
    @Override
    protected void addItemInfo(final ArrayList<MenuItemInfo> itemInfos) {
        itemInfos.add(newItemInfo("测试一", "#4d90fe", new OnClickListener() {

            @Override
            public void onClick(View v) {
                getContext().pushFragmentToBackStack(SliderBannerDemoFragment.class, null);
            }
        }));

        itemInfos.add(newItemInfo("测试二", "#4d90fe", new OnClickListener() {

            @Override
            public void onClick(View v) {
                //getContext().pushFragmentToBackStack(LoadMoreGridViewFragment.class, null);
            }
        }));
    }

    @Override
    public void pullToRefreshHandler() {
        mItemInfos.add(newItemInfo("测试三", "#4d90fe", new OnClickListener() {

            @Override
            public void onClick(View v) {
                //getContext().pushFragmentToBackStack(LoadMoreGridViewFragment.class, null);
            }
        }));
        notifyUpdateView();
    }

    @Override
    protected boolean enableDefaultBack() {
        return true;
    }

    @Override
    protected boolean enablePullRefresh() {
        return true;
    }
}
